/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.z100h.supplychain.core.biz.entity;

import com.jeeplus.core.persistence.DataEntity;
import com.z100h.supplychain.core.EvidenceState;
import com.z100h.supplychain.core.EvidenceType;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 各种单子凭证Entity
 * @author fyh
 * @version 2019-01-03
 */
public class CommonEvidence extends DataEntity<CommonEvidence> {

	private static final long serialVersionUID = 1L;
	/**
	 * 凭证类型
	 */
	private String type; 

	/**
	 * 状态
	 */
	private Integer state; 
	
	private EvidenceType evidenceType;
	
	public EvidenceType getEvidenceType() {
		return evidenceType;
	}

	public void setEvidenceType(EvidenceType evidenceType) {
		this.evidenceType = evidenceType;
	}

	public CommonEvidence() {
		super();
		this.setIdType(IDTYPE_AUTO);
	}

	public CommonEvidence(EvidenceType evidenceType, EvidenceState evidenceState) {
		super();
		this.type = evidenceType.getType();
		this.evidenceType = evidenceType;
		this.state = evidenceState.getValue();
		this.setIdType(IDTYPE_AUTO);
	}

	public CommonEvidence(String id) {
		super(id);
	}

	@ExcelField(title = "凭证类型", align = 2, sort = 7)
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
		if(type != null) {
			for(EvidenceType eType : EvidenceType.values()) {
				if(type.equals(eType.getType())){
					this.evidenceType = eType;
					break;
				}
			}
			
		}
		
	}

	@ExcelField(title = "状态", align = 2, sort = 9)
	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	@Override
	@ExcelField(title = "公司id", align = 2, sort = 10)
	public String getCompanyId() {
		return companyId;
	}

	@Override
	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	@Override
	@ExcelField(title = "部门id", align = 2, sort = 11)
	public String getDepartmentId() {
		return departmentId;
	}

	@Override
	public void setDepartmentId(String departmentId) {
		this.departmentId = departmentId;
	}

	@Override
	@ExcelField(title = "岗位id", align = 2, sort = 12)
	public String getStationId() {
		return stationId;
	}

	@Override
	public void setStationId(String stationId) {
		this.stationId = stationId;
	}

}